/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entity;


import com.mysql.jdbc.Statement;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import model.entityTable;
import sql.AConnection;


/**
 *
 * @author aragon
 */
public class DVPT extends AConnection implements entityTable<DVPT>{
    String  iddvpt;
    String tenDV;

    public DVPT(String iddvpt, String tenDV) {
        this.iddvpt = iddvpt;
        this.tenDV = tenDV;
    }
      public boolean select() {
        return false;
    }

   public ResultSet selectDB() {
        try {
            String query = "SELECT iddvpt,TenDV FROM donviphutrach";
            Connection connection=getConnection();
            PreparedStatement ps=connection.prepareStatement(query);
            ResultSet rs=ps.executeQuery();
            
            return rs;
        } catch (SQLException ex) {
            return null;
        }
    }

    public boolean insert() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public boolean update() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public boolean remove() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

   
    public DVPT() {
    }

    public String getIddvpt() {
        return iddvpt;
    }

    public void setIddvpt(String iddvpt) {
        this.iddvpt = iddvpt;
    }

    public String getTenDV() {
        return tenDV;
    }

    public void setTenDV(String tenDV) {
        this.tenDV = tenDV;
    }
    public static void main(String[] args) {
        DVPT dVPT = new DVPT();
        ResultSet rs= dVPT.selectDB();

    }

  
    



}
